# uncompyle6 version 2.15.1
# Python bytecode 2.7 (62211)
# Decompiled from: Python 2.7.10 (default, Jul  1 2017, 13:36:56) 
# [GCC 4.4.6 20110731 (Red Hat 4.4.6-4)]
# Embedded file name: /data/bkce/open_paas/paas/templates_module/saas/release.html.py
# Compiled at: 2018-01-02 11:59:29
from mako import runtime, filters, cache
UNDEFINED = runtime.UNDEFINED
STOP_RENDERING = runtime.STOP_RENDERING
__M_dict_builtin = dict
__M_locals_builtin = locals
_magic_number = 10
_modified_time = 1514865569.024376
_enable_loop = True
_template_filename = '/data/bkce/open_paas/paas/templates/saas/release.html'
_template_uri = 'saas/release.html'
_source_encoding = 'utf-8'
_exports = [u'right_content']

def _mako_get_namespace(context, name):
    try:
        return context.namespaces[(__name__, name)]
    except KeyError:
        _mako_generate_namespaces(context)
        return context.namespaces[(__name__, name)]


def _mako_generate_namespaces(context):
    pass


def _mako_inherit(template, context):
    _mako_generate_namespaces(context)
    return runtime._inherit_from(context, u'/base_center.html', _template_uri)


def render_body(context, **pageargs):
    __M_caller = context.caller_stack._push_frame()
    try:
        __M_locals = __M_dict_builtin(pageargs=pageargs)
        CSS_SUFFIX = context.get('CSS_SUFFIX', UNDEFINED)
        app_state = context.get('app_state', UNDEFINED)
        version_info = context.get('version_info', UNDEFINED)
        STATIC_VERSION = context.get('STATIC_VERSION', UNDEFINED)
        app_code = context.get('app_code', UNDEFINED)
        csrf_token = context.get('csrf_token', UNDEFINED)
        STATIC_URL = context.get('STATIC_URL', UNDEFINED)

        def right_content():
            return render_right_content(context._locals(__M_locals))

        JS_SUFFIX = context.get('JS_SUFFIX', UNDEFINED)
        SITE_URL = context.get('SITE_URL', UNDEFINED)
        __M_writer = context.writer()
        __M_writer(u'\n\n')
        if 'parent' not in context._data or not hasattr(context._data['parent'], 'right_content'):
            context['self'].right_content(**pageargs)
        __M_writer(u'\n<script src="')
        __M_writer(unicode(STATIC_URL))
        __M_writer(u'js/paas_release.')
        __M_writer(unicode(JS_SUFFIX))
        __M_writer(u'?v=')
        __M_writer(unicode(STATIC_VERSION))
        __M_writer(u'"></script>\n<script>\n$(function (argument) {\n    $(\'.choose-file-btn\').click(function(event) {\n        //\u89e6\u53d1\u9009\u62e9\u6587\u4ef6\u7684\u6309\u94ae\n        $(\'#saas_file\').trigger(\'click\');\n    });\n    $(\'#saas_file\').on(\'change\', function(){\n        // \u628a\u8def\u5f84\u53bb\u6389\uff0c\u53ea\u663e\u793a\u6587\u4ef6\u540d\n        var tag = $(\'.import-file-name\').text($(\'#saas_file\').val().split(\'\\\\\')[$(\'#saas_file\').val().split(\'\\\\\').length-1]);\n        if (!tag) {\n            $(\'.import-file-name\').text($(\'#saas_file\').val().split(\'/\')[$(\'#saas_file\').val().split(\'/\').length-1])\n        };\n    });\n\n    $("#saas_file").on("change", function(event) {\n      $("#import_msg").html($("#loading_div").html());\n       //oMsg.text("\u52a0\u8f7d\u4e2d...");\n       file_form.target="target_frame";\n       $(\'#saas_app_online\').attr({"disabled":"disabled"});\n       $(\'#saas_upload\').attr({"disabled":"disabled"});\n       file_form.submit();\n    });\n\n    $(\'#saas_file\').on(\'click\', function(){\n      this.value = null;\n    });\n\n    var app_code = $("#app_code_id").val();\n    var app_state = $("#app_state_id").val();\n\n    // \u672a\u90e8\u7f72\u7684\u5e94\u7528\u5916\uff0c\u5176\u4ed6\u5e94\u7528\u9700\u8981\u8f6e\u8be2\u5f53\u524d\u72b6\u6001\n    if(app_code && app_state != \'1\'){\n      // \u6b63\u5728\u90e8\u7f72\uff0c\u5219\u663e\u793a\u72b6\u6001\u56fe\n      if(app_state == \'8\' || app_state == \'9\' || app_state == \'10\'){\n        $(\'button[n_btn=saas_deploy]\').attr({"disabled":"disabled"});\n        REL_MANAGER.refresh_roll(app_code, app_state, \'#release_msg_pro\', \'\u90e8\u7f72\', 2);\n      }\n      // \u53d1\u8d77\u72b6\u6001\u66f4\u65b0\n      REL_MANAGER.check_unfinished_task(app_code);\n    }\n\n})\n//\u4e0a\u7ebf\u64cd\u4f5c\n$(\'#saas_app_online\').live(\'click\', function(){\n  var saas_app_version_id = $("#saas_app_version_id").text();\n  var app_state = $("#app_state_id").val();\n  if (!saas_app_version_id){\n    $("#import_msg").html($("#file_tips_div").html());\n    return false;\n  }\n  REL_MANAGER.confirm_saas_app_online(this, saas_app_version_id, app_state);\n})\n</script>\n')
        return ''
    finally:
        context.caller_stack._pop_frame()


def render_right_content(context, **pageargs):
    __M_caller = context.caller_stack._push_frame()
    try:
        CSS_SUFFIX = context.get('CSS_SUFFIX', UNDEFINED)
        app_state = context.get('app_state', UNDEFINED)
        version_info = context.get('version_info', UNDEFINED)
        STATIC_VERSION = context.get('STATIC_VERSION', UNDEFINED)
        app_code = context.get('app_code', UNDEFINED)
        csrf_token = context.get('csrf_token', UNDEFINED)
        STATIC_URL = context.get('STATIC_URL', UNDEFINED)

        def right_content():
            return render_right_content(context)

        SITE_URL = context.get('SITE_URL', UNDEFINED)
        __M_writer = context.writer()
        __M_writer(u'\n    <link rel="stylesheet" type="text/css" href="')
        __M_writer(unicode(STATIC_URL))
        __M_writer(u'css/paas_release.')
        __M_writer(unicode(CSS_SUFFIX))
        __M_writer(u'?v=')
        __M_writer(unicode(STATIC_VERSION))
        __M_writer(u'">\n    <link rel="stylesheet" type="text/css" href="')
        __M_writer(unicode(STATIC_URL))
        __M_writer(u'css/paas_saas.')
        __M_writer(unicode(CSS_SUFFIX))
        __M_writer(u'?v=')
        __M_writer(unicode(STATIC_VERSION))
        __M_writer(u'">\n    <!-- \u53f3\u4fa7\u5185\u5bb9 start -->\n    <div class="">\n        <div class="app_center">\n            <div class="box-info full">\n                <div class="main-header">\n')
        if app_code:
            __M_writer(u'                    <span>\u90e8\u7f72\u5e94\u7528\u3010')
            __M_writer(unicode(app_code))
            __M_writer(u'\u3011</span>\n                    \u3000<input type="hidden" id="app_code_id" value="')
            __M_writer(unicode(app_code))
            __M_writer(u'">\n                    \u3000<input type="hidden" id="app_state_id" value="')
            __M_writer(unicode(app_state))
            __M_writer(u'">\n')
        else:
            __M_writer(u'                    <span>\u4e0a\u4f20\u90e8\u7f72\u65b0\u5e94\u7528</span>\n')
        __M_writer(u'                </div>\n                <div class="deploy_box">\n                  <div class="">\n                    <form  id="file_form" enctype="multipart/form-data" method="post" action="')
        __M_writer(unicode(SITE_URL))
        __M_writer(u'saas/upload/')
        __M_writer(unicode(app_code))
        __M_writer(u'/" class="form form-horizontal">\n                      <input type="hidden" name="csrfmiddlewaretoken" value="')
        __M_writer(unicode(csrf_token))
        __M_writer(u'" />\n                      <label class="control-label">\u90e8\u7f72\u6587\u4ef6\uff1a</label>\n                      <div class="inline-block">\n                        <a href="###" id="saas_upload" class="btn btn-default btn-lg choose-file-btn">\u9009\u62e9\u6587\u4ef6</a>\n                        <div class="inline-block">\n                            <span id="file_version_display" class="import-file-name mr15" online_file="')
        __M_writer(unicode(version_info.get('file_version_display', '')))
        __M_writer(u'">')
        __M_writer(unicode(version_info.get('file_version_display', '')))
        __M_writer(u'</span>\n\n\n                            <div id="loading_div" style="display:none"><img alt="loadding" src="')
        __M_writer(unicode(STATIC_URL))
        __M_writer(u'img/loading_2_24x24.gif"> \u6b63\u5728\u4e0a\u4f20...</div>\n                            <div id="file_tips_div" style="display:none">\n                              <span class="text-danger"><i class="bk-icon icon-exclamation-triangle t_b"></i> \u8bf7\u5148\u9009\u62e9\u8981\u90e8\u7f72\u7684\u6587\u4ef6</span>\n                            </div>\n                        </div>\n                        <input name="saas_file" id="saas_file" type="file">\n                      </div>\n                      <div class="pull-right">\n                        <button type="button" id="saas_app_online" n_btn="saas_deploy" class="btn btn-success btn-lg deploy_btn" data-id="online_form">\u4e00\u952e\u90e8\u7f72</button>\n                      </div>\n                      <div id="import_msg" class="import-validate text-success"></div>\n                      <div class="popover bottom deploy_popover deploy_detail" style="display:none; max-width: 940px">\n                        <div class="popover-content">\n                          <div id="release_msg_pro"></div>\n                        </div>\n                      </div>\n                    </form>\n\n                    <span id="saas_app_version_id" style="display:none">')
        __M_writer(unicode(version_info.get('id', '')))
        __M_writer(u'</span>\n                    <iframe name="target_frame" style="display:none;"></iframe>\n\n                    <div class="deploy_tab_box" id="deploy_input">\n                        <div class="">\n                            <!--\u6b63\u5f0f\u90e8\u7f72start TODO-->\n                            <div id="online_form" n_form style="display:none;">\n                            </div>\n                            <!--\u6b63\u5f0f\u90e8\u7f72end-->\n\n                        </div>\n                    </div>\n\n                    <!--\u6d41\u7a0b\u56fe-->\n                    <div id="release-flow-before" class="pt20" style="display:none;">\n                    </div>\n                    <div id="release-flow" class="pt20 mb10" style="display:none;">\n                    </div>\n                    <div id="tips_info" class="pt20 mr30" style="margin-left:20px;max-width:820px;">\n                    </div>\n\n                    <div id="detail_button_2" style="margin-top:15px; margin-left:30px;display:none;">\n                      <a href="javascript:REL_MANAGER.get_app_release_detail()" title="\u70b9\u51fb\u67e5\u770b\u8be6\u60c5" >\n                      <span aria-hidden="true" class="glyphicon glyphicon-list" style="margin-right:5px;"></span>\n                      <span id="detail_click">\u70b9\u51fb\u67e5\u770b\u8be6\u60c5</span>\n                      </a>\n                    </div>\n\n                    <div id="detail_log" class="mt20" style="display:none;">\n                      <textarea id="detail_info" class="form-control" style="height:300px;background-color: #000; color: #FFF;" readonly="">\u90e8\u7f72\u65e5\u5fd7\uff1a------create virtualenv for test1------\n                      </textarea>\n                  </div>\n                  </div>\n                </div>\n            </div>\n        </div>\n    </div>\n    <!-- \u53f3\u4fa7\u5185\u5bb9 end -->\n')
        return ''
    finally:
        context.caller_stack._pop_frame()